package com.aaa.service.back.Impl;

import com.aaa.entity.Emp;
import com.aaa.mapper.back.EmpMapper;
import com.aaa.service.back.EmpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class EmpServiceImpl implements EmpService {

    @Resource
    private EmpMapper empMapper;

    @Override
    public List<Map<String, Object>> findEmp() {
        return empMapper.findEmp();
    }

    @Override
    public Map<String, Object> findByEmpId(Integer empId) {
        return empMapper.findByEmpId(empId);
    }

    @Override
    public int addEmp(Emp emp) {
        return empMapper.addEmp(emp);
    }

    @Override
    public int editEmp(Emp emp) {
        return empMapper.editEmp(emp);
    }

    @Resource
    private EmpMapper em;


    @Override
    public Emp findEmpByName(String empUserName, String empPassword) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("empUserName",empUserName);
        map.put("empPassword",empPassword);
        return em.findEmpByName(map);
    }

    @Override
    public Emp findEmpaccount(Integer empId) {
        return em.findEmpaccount(empId);
    }

    @Override
    public Emp findEmpByEmpId(Integer empId) {
        return em.findEmpByEmpId(empId);
    }
}
